package ObjectOriented;

/**
 * ClassName:Student
 * Package:object_oriented
 * Description:
 * 构造方法
 *
 * @Author:ZhangXin
 * @Create2023/1/14-16:25
 * @Version:v1.0
 */
public class Student {
    private String name;
    private int age;


    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setAge(int age) {
        this.age = age;
        //this的本质：是代表方法调用者的地址值
        //this的作用：区分局部变量和成员变量
    }

    public int getAge() {
        return age;
    }
}
